package org.bear.bundle.framework.controller;

public class MessageType {

	public enum Type {

		INFO(1, "信息"), EXCEPTION(2, "异常");

		private int index;
		private String name;

		private Type(int index, String name) {
			this.index = index;
			this.name = name;
		}

		public static String getNameByIndex(int index) {
			for (Type c : Type.values()) {
				if (c.getIndex() == index) {
					return c.name;
				}
			}
			return null;
		}

		public int getIndex() {
			return index;
		}

		public void setIndex(int index) {
			this.index = index;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

	}

}
